POV-Ray : Newsgroups : povray.off-topic : Error mesage : Re: Error mesage Server Time
7 Sep 2024 13:23:52 EDT (-0400)
  Re: Error mesage  
From: Warp
Date: 1 May 2008 16:08:41
Message: <481a2348@news.povray.org>
. wrote:
> "Orchid XP v8" <voi### [at] devnull> wrote

> > Unfortunately, it has become common for programs to give messages such
> > as "an unexpected error has occurred. Sorry."
> >
> > [BTW, WTF is an *expected* error anyway??]

> Actually, the above *is* an example of an expected error (the programmer put
> that message in, didn't he?). Unexpected errors either go unnoticed or crash
> the system.

  Wrong. Unexpected errors are things which should never happen, and if
they do the indicate a bug in the program.
  Typical example:

switch(something)
{
 case A: ...
 case B: ...
 ...

 default:
    error("Unexpected error happened.");
    // This should never happen because all possible cases were dealt above.
    // If we ever get here, it's a clear sign of a bug in the program.
}

-- 
                                                          - Warp


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.